package com.dk.service.impl;

import com.dk.mapper.TDepMapper;
import com.dk.pojo.TDep;
import com.dk.pojo.TDepExample;
import com.dk.service.TDepServiceI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TDepServiceImpl implements TDepServiceI {
    @Autowired
    private TDepMapper tDepMapper;

    @Override
    public List<TDep> getInfoServer() {

        return tDepMapper.selectByExample(new TDepExample());
    }

    @Override
    public void saveById(TDep tDep) {
        tDepMapper.insertSelective(tDep);
    }

    @Override
    public void deleteById(Integer depId) {
        tDepMapper.deleteByPrimaryKey(depId);
    }

    @Override
    public TDep getNameById(Integer depId) {
        return tDepMapper.selectByPrimaryKey(depId);
    }

    @Override
    public void updateById(TDep tDep) {
        tDepMapper.updateByPrimaryKeySelective(tDep);
    }
}
